﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" EnableEventValidation="false"
    CodeFile="Items.aspx.cs" Inherits="Items" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <style type="text/css">
        div.items ul.productList li
        {
            float: left;
            list-style: none outside none;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h1 id="itemListTitle" runat="server" style="text-align: center; text-decoration: underline;
        text-transform: capitalize; font-size: xx-large; font-weight: bolder;">
        Produkty w kategorii</h1>
    <div class="items" style="">
        <asp:ListView ID="itemsList" runat="server" GroupItemCount="2">
            <LayoutTemplate>
                <table style="width: 100%">
                    <tr>
                        <td>
                            <table style="width: 100%; text-align: center; vertical-align: middle; border: 1px solid red;"
                                cellpadding="5">
                                <asp:PlaceHolder runat="server" ID="groupPlaceHolder"></asp:PlaceHolder>
                            </table>
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
            <GroupTemplate>
                <tr>
                    <asp:PlaceHolder runat="server" ID="itemPlaceHolder"></asp:PlaceHolder>
                </tr>
            </GroupTemplate>
            <ItemTemplate>
                <td style="border: 1px solid red;">
                    <h3>
                        <%# Eval("name") %>
                    </h3>
                    <br />
                    <img alt="<%# Eval("name") %>" src="Images/Image_not_found.jpg" />
                    <h3>
                        <asp:Label Text='<%# "Cena: " +  Eval("price") + " PLN"%>' runat="server"></asp:Label>
                    </h3>
                </td>
            </ItemTemplate>
            <EmptyDataTemplate>
                <div>
                    Przykro nam - nie znaleziono przedmiotów o podanych kryteriach.
                </div>
            </EmptyDataTemplate>
        </asp:ListView>
        <asp:DataPager ID="dpListView" runat="server" PagedControlID="itemsList" PageSize="4">
            <Fields>
                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" ShowLastPageButton="True" />
            </Fields>
        </asp:DataPager>
    </div>
</asp:Content>
